# Aptamer binding thrombin on the outer membrane, by iGEM team TU_Eindhoven 2015


# Model parameters
define TEXTOUTPUT 1
define sysradius 0				#The length of the edge of the system cube in µm. The total volume of the system is the cube of the number specified here. This value depents on the thrombin concentration that you want to simulate
define sysradius2 0 			#Half the value of sysradius, just for coding purpose
define memradius 0.093			# Radius of the sphere representing the E. coli in µm, the value entered here will give a sphere with an area of about one hundredth of a real E. coli.

# Graphical output
graphics opengl					# level of graphics quality (or none)
frame_thickness 1				# turns on display of the system boundaries

# System space and time definitions
dim 3							# 3D system
boundaries 0 -sysradius2 sysradius2			# outermost system boundaries on x axis
boundaries 1 -sysradius2 sysradius2      	# outermost system boundaries on y axis
boundaries 2 -sysradius2 sysradius2			# outermost system boundaries on z axis
time_start 0			# simulation starting time
time_stop 0.1			# simulation stopping time
time_step 0.0000001		# simulation time step

# Molecular species and their properties
species A B T AT BT ABT
difc A(all) 4.5			# diffusion coefficients
difc AT(all) 4.5
difc B(all) 4.5
difc BT(all) 4.5
difc ABT(all) 4.5
difc T(all) 110
color A(all) green		# colors for graphical output
color B(all) red
color AT(all) blue
color BT(all) pink
color ABT(all) orange
color T(all) yellow
display_size all(all) 5	# display sizes for graphical output
display_size T(all) 5


# Surfaces in the system and their properties
start_surface membrane		# start definition of surface
  action both all reflect	# at both surface faces, all molecules reflect
   color both black
  thickness 1				# surface display thickness for graphics
  panel sph 0 0 0 memradius 20 20	# definition of the surface panel
end_surface

start_surface outer			# start definition of surface
  action both all reflect	# at both surface faces, all molecules reflect
 color both black 0
  panel rect +0 -sysradius2 -sysradius2 -sysradius2 sysradius sysradius		#Define system cube
  panel rect +0 sysradius2 -sysradius2 -sysradius2 sysradius sysradius
  
  panel rect +1 -sysradius2 -sysradius2 -sysradius2 sysradius sysradius
  panel rect +1 -sysradius2 sysradius2 -sysradius2 sysradius sysradius
  
  panel rect +2 -sysradius2 -sysradius2 -sysradius2 sysradius sysradius
  panel rect +2 -sysradius2 -sysradius2 sysradius2 sysradius sysradius
end_surface

# Compartment definitions
start_compartment insidesys		# the volume within the cube is the system
  surface outer					# a surface that defines the compartmet bounds
  point 0 0 0					# a point that is within the compartment
end_compartment

start_compartment insidemem		# the volume within the E. coli
  surface membrane				# a surface that defines the compartment bounds
  point 0 0 0					# a point that is within the compartment
end_compartment

start_compartment model			# the volume wherin the thrombin is modeled
  compartment equal insidesys	# the volume is defined as everything inside the system, except the volume of the E. coli
  compartment andnot insidemem 
end_compartment


# Chemical reactions
reaction fwd1 A(up) + T(fsoln) -> AT(up) 77450	# association and disassociation reactions
reaction fwd2 B(up) + T(fsoln) -> BT(up) 77450
reaction bwd1 AT(up) -> A(up) + T(fsoln) 0.00338
product_placement bwd1 pgemmax 0.99
reaction bwd2 BT(up) -> B(up) + T(fsoln) 0.00338
product_placement bwd2 pgemmax 0.99

reaction double1 A(up) + BT(up) -> ABT(up) 77450
reaction double2 AT(up) + B(up) -> ABT(up) 77450
reaction double3 ABT(up) -> A(up) + BT(up) 0.00338
product_placement double3 pgemmax 0.99
reaction double4 ABT(up) -> AT(up) + B(up) 0.00338
product_placement double4 pgemmax 0.99




# Place molecules for initial condition
compartment_mol 1000 T model				#Place 1000 molecules of thrombin in the system, the concentration is determinded by the system volume defined above
surface_mol 50 A(up) membrane all all		#Place 50 membrane protein in the membrane
surface_mol 50 B(up) membrane all all

# Output and other run-time commands
text_display time A(all) B(all) AT(all) BT(all) ABT(all)	# displays species counts to graphics
ifdefine TEXTOUTPUT				# only run this if needed
  output_files output.txt			# file names for text output
  cmd B molcountheader output.txt		# text output run at beginning
  cmd N 10 molcount output.txt		# text output run every 10 time steps
endif

end_file			# end of this file